package cn.sylinx.hbatis.exception;

/**
 * 执行运行时异常
 * @author han
 *
 */
@SuppressWarnings("serial")
public class HbatisException extends RuntimeException implements ErrorCodeRecordable {

	private int code = 500;
	
	public HbatisException() {
		super();
	}
	
	public HbatisException(String message) {
		this(500, message);
	}
	
	public HbatisException(int code, String message) {
		super(message);
		this.code = code;
	}

	public HbatisException(String message, Throwable cause) {
		this(500, message, cause);
	}
	
	public HbatisException(int code, String message, Throwable cause) {
		super(message, cause);
		this.code = code;
	}

	public HbatisException(Throwable cause) {
		super(cause);
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}
}
